﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace Travel.MVC
{
    /// <summary>
    /// 权限验证
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
    public class RolesAuthorizeAttribute : AuthorizeAttributeBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RolesAuthorizeAttribute"/> class.
        /// </summary>
        /// <param name="state">The state.</param>
        public RolesAuthorizeAttribute()
        {
            
        }

        /// <summary>
        /// 判断是否通过其他验证
        /// </summary>
        /// <returns>
        ///   <c>true</c> if this instance is authorized; otherwise, <c>false</c>.
        /// </returns>
        protected override bool IsAuthorized()
        {
            return true;
        }

        /// <summary>
        /// 未通过权限验证的处理
        /// </summary>
        protected override void UnAuthorizedProcess()
        {
            
        }
    }
}